home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 0138 / delphi.zip / PRCNT25.PAS < prev    next >
Pascal/Delphi Source File  |  1996-01-20  |  8KB  |  208 lines

  1. {********************************************}
  2. {*                                          *}
  3. {*  PRCNT25.PAS generated from PRCNT25.VBX  *}
  4. {*                                          *}
  5. {********************************************}
  6.  
  7. unit Prcnt25;
  8.  
  9. interface
  10.  
  11. uses SysUtils, Classes, Graphics, Forms, Controls, VBXCtrl, BIVBX;
  12.  
  13. { $DEFINE InitTPrcnt}
  14. {^- Remove space to enable default init data -- See documentation. }
  15.  
  16. type
  17.   TPrcntChangeEvent = procedure (Sender: TObject) of object;
  18.  
  19.   { TPrcnt }
  20.  
  21.   TPrcnt = class(TVBXControl)
  22.   protected
  23.     FOnChange: TPrcntChangeEvent;
  24.     { Event handler }
  25.     procedure HandleVBXEvent(var Message: TWMVBXFireEvent); override;
  26.     procedure DefineProperties(Filer: TFiler); override;
  27.   public
  28.     constructor Create(AOwner: TComponent); override;
  29.  
  30.     property Index: TVBInteger index 0 read GetIntProp;
  31.     property FontName: TVBString index 13 read GetStringProp write
  32.       SetStringProp;
  33.     property FontBold: Boolean index 14 read GetBoolProp write SetBoolProp;
  34.     property FontItalic: Boolean index 15 read GetBoolProp write SetBoolProp;
  35.     property FontStrikethru: Boolean index 16 read GetBoolProp write
  36.       SetBoolProp;
  37.     property FontUnderline: Boolean index 17 read GetBoolProp write
  38.       SetBoolProp;
  39.     property FontSize: Single index 18 read GetSingleProp write SetSingleProp;
  40.     property AVersion: Single index 19 read GetSingleProp write SetSingleProp;
  41.     property Redraw: Boolean index 55 read GetBoolProp write SetBoolProp;
  42.     property RedrawStatic: Boolean index 56 read GetBoolProp write
  43.       SetBoolProp;
  44.     property ZLoad: TVBInteger index 60 read GetIntProp write SetIntProp;
  45.   published
  46.     property Enabled;
  47.     property Visible;
  48.     property MousePointer: TVBEnum index 8 read GetEnumProp write SetEnumProp
  49.       default 0;
  50.     property TabOrder;
  51.     property TabStop;
  52.     property About: TVBString index 20 read GetStringProp {NoRT}write
  53.       SetStringProp stored False;
  54.     property BevelWidth: TVBInteger index 21 read GetIntProp write SetIntProp;
  55.     property BevelInner: TVBEnum index 22 read GetEnumProp write SetEnumProp;
  56.     property BevelOuter: TVBEnum index 23 read GetEnumProp write SetEnumProp;
  57.     property BorderWidth: TVBInteger index 24 read GetIntProp write
  58.       SetIntProp;
  59.     property Max: Single index 25 read GetSingleProp write SetSingleProp;
  60.     property Min: Single index 26 read GetSingleProp write SetSingleProp;
  61.     property Value: Single index 27 read GetSingleProp write SetSingleProp;
  62.     property BackColor: TColor index 28 read GetColorProp write SetColorProp;
  63.     property BackPicture: TVBPic index 29 read GetPictureProp write
  64.       SetPictureProp stored False;
  65.     property OnColor: TColor index 30 read GetColorProp write SetColorProp;
  66.     property OnPicture: TVBPic index 31 read GetPictureProp write
  67.       SetPictureProp stored False;
  68.     property OffColor: TColor index 32 read GetColorProp write SetColorProp;
  69.     property OffPicture: TVBPic index 33 read GetPictureProp write
  70.       SetPictureProp stored False;
  71.     property BarBorder: Single index 34 read GetSingleProp write
  72.       SetSingleProp;
  73.     property BarInner: Single index 35 read GetSingleProp write SetSingleProp;
  74.     property BarOuter: Single index 36 read GetSingleProp write SetSingleProp;
  75.     property Orientation: TVBEnum index 37 read GetEnumProp write SetEnumProp;
  76.     property Direction: TVBEnum index 38 read GetEnumProp write SetEnumProp;
  77.     property MouseControl: Boolean index 39 read GetBoolProp write
  78.       SetBoolProp;
  79.     property Percent: Single index 40 read GetSingleProp write SetSingleProp;
  80.     property PercentColor: TColor index 41 read GetColorProp write
  81.       SetColorProp;
  82.     property PercentStyle: TVBEnum index 42 read GetEnumProp write
  83.       SetEnumProp;
  84.     property PercentFontID: TVBInteger index 43 read GetIntProp write
  85.       SetIntProp;
  86.     property ShapeStyle: TVBEnum index 44 read GetEnumProp write SetEnumProp;
  87.     property Shape: TVBString index 45 read GetStringProp write SetStringProp;
  88.     property DisplayMode: TVBEnum index 46 read GetEnumProp write SetEnumProp;
  89.     property Captions: TVBInteger index 47 read GetIntProp write SetIntProp;
  90.     property CaptionID: TVBInteger index 48 read GetIntProp write SetIntProp;
  91.     property Caption: TVBString index 49 read GetStringProp write
  92.       SetStringProp stored False;
  93.     property CaptionX: Single index 50 read GetSingleProp write SetSingleProp
  94.       stored False;
  95.     property CaptionY: Single index 51 read GetSingleProp write SetSingleProp
  96.       stored False;
  97.     property CaptionColor: TColor index 52 read GetColorProp write
  98.       SetColorProp stored False;
  99.     property CaptionFontID: TVBInteger index 53 read GetIntProp write
  100.       SetIntProp stored False;
  101.     property AutoRedraw: Boolean index 54 read GetBoolProp write SetBoolProp;
  102.     property FontID: TVBInteger index 57 read GetIntProp write SetIntProp;
  103.     property Fonts: TVBInteger index 58 read GetIntProp write SetIntProp
  104.       stored False;
  105.     property FontDialog_: TVBString index 59 read GetStringProp {NoRT}write
  106.       SetStringProp stored False;
  107.     property OnClick;
  108.     property OnDragDrop;
  109.     property OnEndDrag;
  110.     property OnDragOver;
  111.     property OnEnter;
  112.     property OnKeyDown;
  113.     property OnKeyPress;
  114.     property OnKeyUp;
  115.     property OnExit;
  116.     property OnMouseDown;
  117.     property OnMouseMove;
  118.     property OnMouseUp;
  119.     property OnChange: TPrcntChangeEvent read FOnChange write FOnChange;
  120.   end;
  121.  
  122. procedure Register;
  123.  
  124. implementation
  125.  
  126. { Default form data for TPrcnt }
  127.  
  128. {$IFDEF InitTPrcnt}
  129.  
  130. const
  131.   TPrcntInitLen = 192;
  132.  
  133. procedure TPrcntInitData; near; assembler;
  134. asm
  135.     DB    $00,$00,$00,$02,$06,$FF,$FF,$07,$FF,$FF,$08,$00,$09,$00,$00,$0A
  136.     DB    $00,$00,$0B,$00,$0C,$05,$50,$72,$63,$6E,$74,$13,$62,$10,$20,$40
  137.     DB    $15,$02,$00,$16,$01,$17,$02,$18,$02,$00,$19,$00,$00,$C8,$42,$1A
  138.     DB    $00,$00,$00,$00,$1B,$00,$00,$48,$42,$1C,$C0,$C0,$C0,$00,$1E,$00
  139.     DB    $00,$6E,$00,$20,$FF,$FF,$FF,$00,$22,$CD,$CC,$CC,$3D,$23,$CD,$CC
  140.     DB    $4C,$3E,$24,$CD,$CC,$4C,$3F,$25,$00,$26,$00,$27,$FF,$FF,$28,$00
  141.     DB    $00,$48,$42,$29,$00,$00,$00,$00,$2A,$00,$2B,$00,$00,$2C,$00,$2D
  142.     DB    $00,$2E,$00,$2F,$00,$00,$30,$00,$00,$31,$32,$33,$34,$35,$36,$FF
  143.     DB    $FF,$39,$00,$00,$3C,$C8,$D3,$00,$00,$00,$00,$01,$00,$10,$00,$07
  144.     DB    $00,$00,$00,$00,$00,$BC,$02,$00,$00,$00,$00,$01,$02,$02,$22,$53
  145.     DB    $79,$73,$74,$65,$6D,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  146.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FF
  147. end;
  148.  
  149. {$ENDIF}
  150.  
  151. { TPrcnt }
  152.  
  153. constructor TPrcnt.Create(AOwner: TComponent);
  154. begin
  155.   FVBXFile := StrNew('PRCNT25.VBX');
  156.   FVBXClass := StrNew('PRCNT');
  157.   SetBounds(0, 0, 80, 32);
  158.   inherited Create(AOwner);
  159.   ControlStyle := ControlStyle - [csCaptureMouse, csClickEvents];
  160.   TabStop := True;
  161.   FVBXFlags := [vfLoadMessage];
  162.   {$IFDEF InitTPrcnt}
  163.   FHForm := VBXCreateFormFile(TPrcntInitLen, @TPrcntInitData);
  164.   {$ENDIF}
  165. end;
  166.  
  167. procedure TPrcnt.HandleVBXEvent(var Message: TWMVBXFireEvent);
  168. begin
  169.   case Message.VBXEvent^.EventIndex of
  170.     0: DispatchNotifyEvent(OnClick);
  171.     1: begin end; { VCL Handles OnDragDrop }
  172.     2: begin end; { VCL Handles OnDragOver }
  173.     3: begin end; { VCL Handles OnGotFocus }
  174.     4: DispatchKeyEvent(OnKeyDown, Message);
  175.     5: DispatchKeyPressedEvent(OnKeyPress, Message);
  176.     6: DispatchKeyEvent(OnKeyUp, Message);
  177.     7: begin end; { VCL Handles OnLostFocus }
  178.     8: DispatchMouseEvent(OnMouseDown, Message);
  179.     9: DispatchMouseMoveEvent(OnMouseMove, Message);
  180.     10: DispatchMouseEvent(OnMouseUp, Message);
  181.     11: DispatchCustomEvent(FOnChange, Message, 11);
  182.   end;
  183. end;
  184.  
  185. procedure TPrcnt.DefineProperties(Filer: TFiler);
  186. begin
  187.   inherited DefineProperties(Filer);
  188.   HandleProperty('AVersion', Filer, 19);
  189.   HandleBinaryProperty('BackPicture_Data', Filer, 29);
  190.   HandleBinaryProperty('OnPicture_Data', Filer, 31);
  191.   HandleBinaryProperty('OffPicture_Data', Filer, 33);
  192.   HandleBinaryProperty('Caption_Data', Filer, 49);
  193.   HandleBinaryProperty('CaptionX_Data', Filer, 50);
  194.   HandleBinaryProperty('CaptionY_Data', Filer, 51);
  195.   HandleBinaryProperty('CaptionColor_Data', Filer, 52);
  196.   HandleBinaryProperty('CaptionFontID_Data', Filer, 53);
  197.   HandleBinaryProperty('ZLoad', Filer, 60);
  198. end;
  199.  
  200. { Designer registration }
  201. procedure Register;
  202. begin
  203.   RegisterComponents('VBX', [
  204.     TPrcnt]);
  205. end;
  206.  
  207. end.
  208.